package com.meimeixia.pattern.factory.factory_method;

/**
 * @author liayun
 * @create 2021-06-01 17:57
 */
public class Client {
    public static void main(String[] args) {
        // 创建咖啡店对象
        CoffeeStore store = new CoffeeStore();
        // 创建具体工厂对象
         CoffeeFactory factory = new AmericanCoffeeFactory();
//        CoffeeFactory factory = new LatteCoffeeFactory();
        store.setFactory(factory);
        // 点咖啡
        Coffee coffee = store.orderCoffee();
        System.out.println(coffee.getName());
    }
}
